export default {
  finishedTodos(state) {
    return state.todos.filter((todo) => todo.isFinished);
  },
  unfinishedTodos(state) {
    const result = state.todos.filter((todo) => !todo.isFinished);
    console.log('result', result);
    return result;
  },
  filteredTodos(state, getters) {
    console.log('filter=>', state.filter);
    switch (state.filter) {
      case 'finished':
        return getters.finishedTodos;
      case 'unfinished':
        return getters.unfinishedTodos;
      default:
        return state.todos;
    }
  },
};
